home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / July 96 / Re Externalize⁄Internalize Pro < prev    next >
Encoding:
Internet Message Format  |  1996-07-30  |  1.2 KB  |  [TEXT/ttxt]

  1. Subject:     Re: Externalize/Internalize Problem
  2. Sent:        7/29/96 8:30 PM
  3. Received:    7/30/96 9:18 AM
  4. From:        john paulson, paulson3@apple.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8.   When an ODStorageUnitSink is created, su->Focus() is called.  The 
  9. second su->Focus() will 
  10. cause the previously written data to be overwritten.  To solve the 
  11. problem, create a single 
  12. FW_PStorageUnitSink in Externalize/Internalize.  Declare 
  13. ExternalizeProxyList() and 
  14. ExternalizeMyData() to take an FW_OStorageUnitSink * (instead of an 
  15. ODStorageUnit *).  Call 
  16. the routines with the FW_PStorageUnitSink.  No double Focus() occurs.
  17.  
  18.  
  19. >My Externalize/Internalize is in two steps.
  20. >
  21. >void CMyContent::Externalize(...)
  22. >{
  23. >    ExternalizeProxyList(ev, storageUnit, cloneInfo);
  24. >    ExternalizeMyData(ev, storageUnit, cloneInfo);
  25. >}
  26. >
  27. >FW_Boolean CMyContent::Internalize(...)
  28. >{
  29. >    FW_Boolean bResult = false;
  30. >
  31. >    if (storageUnit->Exists(ev, kODPropContents, fMyPart->GetPartKind(ev), 0))
  32. >    {
  33. >        InternalizeProxyList(ev, storageUnit, cloneInfo);
  34. >        InternalizeMyData(ev, storageUnit, cloneInfo);
  35. >    //....
  36. >    bResult = true;
  37. >  }
  38. >  return bResult;
  39. >}
  40.